.class public Lcom/zuimeia/ui/view/ZMViewPager;
.super Landroid/support/v4/view/ViewPager;
.source "ZMViewPager.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/zuimeia/ui/view/ZMViewPager$FixedSpeedScroller;
    }
.end annotation


# instance fields
.field private mDownX:F

.field private mEnabled:Z


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .registers 3
    .param p1, "context"    # Landroid/content/Context;

    .prologue
    .line 19
    invoke-direct {p0, p1}, Landroid/support/v4/view/ViewPager;-><init>(Landroid/content/Context;)V

    .line 16
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/zuimeia/ui/view/ZMViewPager;->mEnabled:Z

    .line 20
    invoke-direct {p0}, Lcom/zuimeia/ui/view/ZMViewPager;->init()V

    .line 21
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .registers 4
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "attrs"    # Landroid/util/AttributeSet;

    .prologue
    .line 24
    invoke-direct {p0, p1, p2}, Landroid/support/v4/view/ViewPager;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 16
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/zuimeia/ui/view/ZMViewPager;->mEnabled:Z

    .line 25
    invoke-direct {p0}, Lcom/zuimeia/ui/view/ZMViewPager;->init()V

    .line 26
    return-void
.end method

.method private init()V
    .registers 7

    .prologue
    .line 30
    :try_start_0
    const-class v3, Landroid/support/v4/view/ViewPager;

    const-string v4, "mScroller"

    invoke-virtual {v3, v4}, Ljava/lang/Class;->getDeclaredField(Ljava/lang/String;)Ljava/lang/reflect/Field;

    move-result-object v1

    .line 31
    .local v1, "mField":Ljava/lang/reflect/Field;
    const/4 v3, 0x1

    invoke-virtual {v1, v3}, Ljava/lang/reflect/Field;->setAccessible(Z)V

    .line 33
    new-instance v2, Lcom/zuimeia/ui/view/ZMViewPager$FixedSpeedScroller;

    invoke-virtual {p0}, Lcom/zuimeia/ui/view/ZMViewPager;->getContext()Landroid/content/Context;

    move-result-object v3

    new-instance v4, Landroid/view/animation/OvershootInterpolator;

    const v5, 0x3f19999a

    invoke-direct {v4, v5}, Landroid/view/animation/OvershootInterpolator;-><init>(F)V

    invoke-direct {v2, p0, v3, v4}, Lcom/zuimeia/ui/view/ZMViewPager$FixedSpeedScroller;-><init>(Lcom/zuimeia/ui/view/ZMViewPager;Landroid/content/Context;Landroid/view/animation/Interpolator;)V

    .line 34
    .local v2, "mScroller":Lcom/zuimeia/ui/view/ZMViewPager$FixedSpeedScroller;
    const/16 v3, 0x15e

    invoke-virtual {v2, v3}, Lcom/zuimeia/ui/view/ZMViewPager$FixedSpeedScroller;->setmDuration(I)V

    .line 35
    invoke-virtual {v1, p0, v2}, Ljava/lang/reflect/Field;->set(Ljava/lang/Object;Ljava/lang/Object;)V
    :try_end_25
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_25} :catch_26

    .line 39
    .end local v1    # "mField":Ljava/lang/reflect/Field;
    .end local v2    # "mScroller":Lcom/zuimeia/ui/view/ZMViewPager$FixedSpeedScroller;
    :goto_25
    return-void

    .line 36
    :catch_26
    move-exception v0

    .line 37
    .local v0, "e":Ljava/lang/Exception;
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_25
.end method


# virtual methods
.method public isScrollEnabled()Z
    .registers 2

    .prologue
    .line 80
    iget-boolean v0, p0, Lcom/zuimeia/ui/view/ZMViewPager;->mEnabled:Z

    return v0
.end method

.method public onInterceptTouchEvent(Landroid/view/MotionEvent;)Z
    .registers 5
    .param p1, "event"    # Landroid/view/MotionEvent;

    .prologue
    const/4 v0, 0x0

    .line 43
    iget-boolean v1, p0, Lcom/zuimeia/ui/view/ZMViewPager;->mEnabled:Z

    if-nez v1, :cond_6

    .line 64
    :goto_5
    return v0

    .line 47
    :cond_6
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I

    move-result v1

    packed-switch v1, :pswitch_data_34

    .line 64
    :cond_d
    :goto_d
    :pswitch_d
    invoke-super {p0, p1}, Landroid/support/v4/view/ViewPager;->onInterceptTouchEvent(Landroid/view/MotionEvent;)Z

    move-result v0

    goto :goto_5

    .line 49
    :pswitch_12
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F

    move-result v0

    iput v0, p0, Lcom/zuimeia/ui/view/ZMViewPager;->mDownX:F

    goto :goto_d

    .line 53
    :pswitch_19
    invoke-virtual {p0}, Lcom/zuimeia/ui/view/ZMViewPager;->getCurrentItem()I

    move-result v1

    invoke-virtual {p0}, Lcom/zuimeia/ui/view/ZMViewPager;->getAdapter()Landroid/support/v4/view/PagerAdapter;

    move-result-object v2

    invoke-virtual {v2}, Landroid/support/v4/view/PagerAdapter;->getCount()I

    move-result v2

    add-int/lit8 v2, v2, -0x1

    if-ne v1, v2, :cond_d

    .line 54
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F

    move-result v1

    iget v2, p0, Lcom/zuimeia/ui/view/ZMViewPager;->mDownX:F

    cmpg-float v1, v1, v2

    if-gez v1, :cond_d

    goto :goto_5

    .line 47
    :pswitch_data_34
    .packed-switch 0x0
        :pswitch_12
        :pswitch_d
        :pswitch_19
    .end packed-switch
.end method

.method public onTouchEvent(Landroid/view/MotionEvent;)Z
    .registers 3
    .param p1, "arg0"    # Landroid/view/MotionEvent;

    .prologue
    .line 69
    iget-boolean v0, p0, Lcom/zuimeia/ui/view/ZMViewPager;->mEnabled:Z

    if-nez v0, :cond_6

    .line 70
    const/4 v0, 0x0

    .line 72
    :goto_5
    return v0

    :cond_6
    invoke-super {p0, p1}, Landroid/support/v4/view/ViewPager;->onTouchEvent(Landroid/view/MotionEvent;)Z

    move-result v0

    goto :goto_5
.end method

.method public setScrollEnabled(Z)V
    .registers 2
    .param p1, "enabled"    # Z

    .prologue
    .line 76
    iput-boolean p1, p0, Lcom/zuimeia/ui/view/ZMViewPager;->mEnabled:Z

    .line 77
    return-void
.end method
